Skip to content

feat(import): import legacy person avatars (#130)#143

Open
themightychris wants to merge 3 commits into
developfrom
feat/import-person-avatars
Open

feat(import): import legacy person avatars (#130)#143
themightychris wants to merge 3 commits into
developfrom
feat/import-person-avatars

Conversation

@themightychris

Copy link
Copy Markdown
Member

Closes the #130 leadership-feedback item — legacy users showed initials where their codeforphilly.org photo used to be.

Spike result

Probed the live laddr API: a person's photo is person.PrimaryPhotoIDGET /media/<id> (confirmed 200, image/jpeg). Projects have no image field in laddr, so this is person avatars only (no project art to import).

What

  • RawPersonSchema now parses PrimaryPhotoID.
  • For each person with one, the importer fetches /media/<id>, runs it through the existing processAvatar (square original + 128px thumb), stores both as gitsheets attachments (avatar.jpg + avatar-128.jpg), and sets avatarKey = people/<slug>/avatar.jpg — the same convention as POST /api/people/:slug/avatar.
  • Reuses the proven blog-media machinery (fetchMediaBytes + BlobObject.write + setAttachments), concurrency 4, failures non-fatal (the person still imports).

No spec change — the avatar storage contract already exists; this just populates it at import time.

Tests

New importer case: a person with PrimaryPhotoID gets the two avatar attachments + avatarKey; one without gets neither. import-laddr 37/37, type-check + lint clean.

Note

Many photo-bearing accounts are spam, but the spam-prune (#133) removes them downstream — net imported avatars skew to real members. (import → prune ordering is documented in spam-detection.md.)

🤖 Generated with Claude Code

themightychris and others added 3 commits June 27, 2026 18:01
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Legacy users showed initials where their codeforphilly.org photo used to be —
the importer brought blog media but never person avatars. A spike found the
source: person.PrimaryPhotoID → GET /media/<id>. (Projects have no image field
in laddr, so this is avatars only.)

RawPersonSchema now parses PrimaryPhotoID. For each person with one, the
importer fetches /media/<id>, runs it through the existing processAvatar
(square original + 128px thumb), stores both as gitsheets attachments
(avatar.jpg + avatar-128.jpg), and sets avatarKey — the same convention as the
avatar-upload route. Reuses the blog-media machinery (fetchMediaBytes +
BlobObject.write + setAttachments), concurrency 4, failures non-fatal.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant